package parser.domain;

public class NonTerminalSymbol implements Symbol{
	String symbol;

	public NonTerminalSymbol(String value) {
		//if (value.toUpperCase().equals(value) && value.length() >= 1) {
			symbol = value;
		//} else {
		//	throw new IllegalArgumentException(
		//			"Terminal symbols must be uppercase and have length exactly 1");
		//}
	}

	public String getSymbol() {
		return symbol;
	}
	
	@Override
	public String toString() {
		return  symbol ;
	}

	@Override
	public int hashCode() {
		return symbol.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NonTerminalSymbol other = (NonTerminalSymbol) obj;
		if (symbol == null) {
			if (other.symbol != null)
				return false;
		} else if (!symbol.equals(other.symbol))
			return false;
		return true;
	}
	
	

}
